/* Light mode (default) */
:root {
  --text-color: #333;
  --background-color: #fff;
  --link-color: #0366d6;
  --link-hover-color: #0056b3;
  --code-background: #f6f8fa;
  --border-color: #ddd;
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --background-color: #1a1a1a;
    --link-color: #4da3ff;
    --link-hover-color: #80bdff;
    --code-background: #2a2a2a;
    --border-color: #444;
  }
}

/* Apply styles using CSS variables */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

/* Wrapper for content */
.content-wrapper {
  max-width: 900px;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  background-color: var(--background-color);
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1em auto;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

/* Center-align the content in the first p tag (logo) */
p:first-of-type {
  text-align: center;
}

/* Hide the #title-block-header inserted by pandoc */
#title-block-header {
  display: none;
}

/* Style for the title */
h1 {
  text-align: center;
  font-size: 3em;
  margin-top: 0.5em;
}

/* Style for the pronunciation */
p:nth-of-type(2) {
  text-align: center;
  font-style: italic;
  margin-top: -0.5em;
  font-size: 1.2em;
}

/* Style for links */
p:nth-of-type(3) {
  text-align: center;
  font-size: 1.1em;
}

/* Style for badges */
p:nth-of-type(4), p:nth-of-type(5), p:nth-of-type(6) {
  text-align: center;
}

/* Adjust badge sizes */
p:nth-of-type(4) img, p:nth-of-type(5) img, p:nth-of-type(6) img {
  display: inline-block;
  vertical-align: middle;
  margin: 0.2em;
}

/* Style for main description */
p:nth-of-type(7) {
  font-size: 1.1em;
  margin-top: 2em;
  margin-bottom: 2em;
}

code, pre {
  background-color: var(--code-background);
  font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 85%;
  border-radius: 3px;
}

pre {
  padding: 16px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1em;
}

th, td {
  border: 1px solid var(--border-color);
  padding: 8px;
  text-align: left;
}

th {
  background-color: var(--code-background);
}

code span.fu {
  color: #22863a;
}

@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  .content-wrapper {
    padding: 10px;
  }

  h1 {
    font-size: 2.5em;
  }
}
